import React, {Component} from 'react';
import './App.css';
import FirstComponent from "./ori/FirstComponent";
import SecondComponent from "./ori/SecondComponent";
import FirstComponentEx from "./ex/FirstComponentEx";
import SecondComponentEx from "./ex/SecondComponentEx";
import FirstComponentHoc from "./hoc/FirstComponentHoc";
import SecondComponentHoc from "./hoc/SecondComponentHoc";
import {FirstComponentMix} from "./mix/FirstComponentMix";
import {SecondComponentMix} from "./mix/SecondComponentMix";
import createForm from "./rc_form/createForm";

class App extends Component {
  render() {
    return (
        <div className="App">
          {/*<h2>直接使用</h2>*/}
          {/*<FirstComponent/>*/}
          {/*<SecondComponent/>*/}
          {/*<h2>继承的方式</h2>*/}
          {/*<FirstComponentEx/>*/}
          {/*<SecondComponentEx/>*/}
          {/*<h2>mix方式</h2>*/}
          {/*<FirstComponentMix/>*/}
          {/*<SecondComponentMix/>*/}
          {/*<h2>高阶组件的方式</h2>*/}
          {/*<FirstComponentHoc/>*/}
          {/*<SecondComponentHoc/>*/}
          <div>
            {this.props.form.getFieldDecorator("age", {
              rules: [{required: true, message: "请填写群组名"}],
              initialValue: "123"
            })(<input onChange={()=>{
              console.log("input.onChange");
            }}/>)}
            <button onClick={() => {
              console.log(this.props.form.getFieldValue("age"))
            }}>提交
            </button>
          </div>
        </div>
    );
  }
}

export default createForm()(App);
